<template>
  <div class="setting-card">
    <el-form :model="form" ref="ruleFormRef" :rules="rules">
      <el-form-item label="客户端路径" prop="url">
        <el-input type="textarea" v-model="form.url" placeholder="请输入"></el-input>
      </el-form-item>
    </el-form>
  </div>
  <div class="setting-foot">
    <el-button type="primary" @click="submitForm(ruleFormRef)">确认更新</el-button>
  </div>
</template>
<script setup>
import { ref } from "vue";
const ruleFormRef = ref();
const form = ref({
  url: ""
});
const rules = ref({
  url: [
    { required: true, message: "请输入客户端路径", trigger: "blur" },
  ]
});
const submitForm = async (formEl) => {
  if (!formEl) return;
  await formEl.validate((valid, fields) => {
    if (valid) {
      console.log("submit!");
    } else {
      console.log("error submit!", fields);
    }
  });
};
</script>
<style lang="scss" scoped>
.setting-card {
  border: 1px solid #e4e4e4;
  padding: 24px 16px;

  ::v-deep textarea {
    width: 290px;
    height: 116px;
    padding: 5px 8px;
    box-sizing: border-box;
  }
}

.el-form-item {
  margin-bottom: 0;
}

.setting-foot {
  margin-top: 24px;
  text-align: right;
}
</style>